LIBS_PATH = /home/mandar/unpv13e

CC = gcc

LIBS = -lresolv -lnsl -lpthread\
	${LIBS_PATH}/libunp.a\
	
FLAGS = -g -O2

CFLAGS = ${FLAGS} -I${LIBS_PATH}/lib

PROGS = client server
# client1 server1 

all: ${PROGS}

client: client.o get_ifi_info_plus.o get_subnet_mask.o 
	${CC} ${FLAGS} -o client client.o get_ifi_info_plus.o get_subnet_mask.o ${LIBS}
client.o: client.c
	${CC} ${CFLAGS} -c client.c 

get_subnet_mask.o: get_subnet_mask.c
	${CC} ${CFLAGS} -c get_subnet_mask.c 

	
#client1: client1.o get_ifi_info_plus.o 
#	${CC} ${FLAGS} -o client1 client1.o get_ifi_info_plus.o ${LIBS}
#client1.o: client1.c
#	${CC} ${CFLAGS} -c client1.c 
	
server: server.o get_ifi_info_plus.o sigchldwaitpid.o get_subnet_mask.o 
	${CC} ${FLAGS} -o server server.o get_ifi_info_plus.o sigchldwaitpid.o get_subnet_mask.o ${LIBS}
server.o: server.c
	${CC} ${CFLAGS} -c server.c

#server1: server1.o get_ifi_info_plus.o 
#	${CC} ${FLAGS} -o server1 server1.o get_ifi_info_plus.o  ${LIBS}
#server1.o: server1.c
#	${CC} ${CFLAGS} -c server1.c
	
get_ifi_info_plus.o: get_ifi_info_plus.c
	${CC} ${CFLAGS} -c get_ifi_info_plus.c	
	
sigchldwaitpid.o: ${LIBS_PATH}/tcpcliserv/sigchldwaitpid.c
	${CC} ${CFLAGS} -c ${LIBS_PATH}/tcpcliserv/sigchldwaitpid.c

clean:
	rm client server *.o 
#    client1 server1

